project(PlaneGame)
cmake_minimum_required(VERSION 2.4)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# Add global definitions
add_definitions("-Wall")

if (WIN32)
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mwindows -Dmain=SDL_main")
endif()

add_executable(planegame main.cpp)

find_package(SDL2 CONFIG REQUIRED)
find_package(sdl2-image CONFIG REQUIRED)
find_package(sdl2-ttf CONFIG REQUIRED)

if (UNIX)
	target_link_libraries(planegame PRIVATE
			SDL2::SDL2
			SDL2::SDL2main
			SDL2::SDL2-static
			SDL2::SDL2_image
			SDL2::SDL2_ttf)
elseif (WIN32)
	target_link_libraries(planegame mingw32 SDL2main SDL2 SDL2_image SDL2_ttf)
endif()

install(TARGETS planegame DESTINATION bin)